Skip to content

fix(extensions): hyphenate in-body command refs when rendering skills#3476

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/ext-skills-body-refs
Open

fix(extensions): hyphenate in-body command refs when rendering skills#3476
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/ext-skills-body-refs

Conversation

@Quratulain-bilal

@Quratulain-bilal Quratulain-bilal commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

fixes #3451

extension command bodies were copied verbatim into generated SKILL.md files for skills-based integrations (codex, claude, etc.), so an in-body reference like /speckit.foo.bar kept its slash-dot spelling. skills agents dispatch speckit-foo-bar skills, not /speckit.foo.bar slash commands, so the reference was not runnable and the agent fell back to a markdown-only path (as reported in discussion #3422 with codex + spec-kit-memory-hub).

root cause (matches the issue): _register_extension_skills only ran resolve_skill_placeholders (script/args/__AGENT__/project-relative paths) and post_process_skill_content (which for SkillsIntegration only injects a hook-note), never a body-ref rewrite. the skill dir name and frontmatter hook refs were already hyphenated elsewhere; the body was the missing piece.

fix: apply the existing CommandRegistrar._hyphenate_body_refs helper in the skills render path, right after resolve_skill_placeholders. that helper is already used on the cline extension path (agents.py); this reuses it. skills integrations always dispatch hyphenated skills, so the rewrite is unconditionally correct there.

added a regression test: it installs an extension whose command body references a sibling command (/speckit.test-ext.world) and asserts the generated skill body has the dotted ref rewritten to speckit-test-ext-world. i confirmed it fails on the pre-fix code (the verbatim speckit.test-ext.world leaks into the body); the full extension-skills suite (58 tests) passes with the fix.

this covers part 1 (code) of the issue's proposed fix. i left the docs-portability note (part 2) out of this PR to keep it focused; happy to follow up if you'd like it here.

extension command bodies were copied verbatim into generated SKILL.md files
for skills-based integrations (codex, claude, etc.), so an in-body reference
like /speckit.foo.bar kept its slash-dot spelling. skills agents dispatch
speckit-foo-bar skills, not /speckit.foo.bar slash commands, so the reference
was not runnable and the agent fell back to a markdown-only path.

the skill dir name and frontmatter hook refs were already hyphenated; the
body was the missing piece. _register_extension_skills only ran
resolve_skill_placeholders (script/args/paths) and post_process_skill_content
(a hook-note only), never _hyphenate_body_refs. that helper already exists and
is applied on the cline extension path; apply it here too.

added a regression test that installs an extension whose command body
references a sibling command and asserts the dotted ref is rewritten to the
hyphenated skill name. confirmed it fails on the pre-fix code.
@Quratulain-bilal Quratulain-bilal requested a review from mnriem as a code owner July 11, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Extension command references not rewritten for skills-based integrations (Codex), breaking cross-command invocation

1 participant